package com.yc.c133.hello;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.*;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.core.annotation.Order;

import javax.servlet.Servlet;

@Order(Integer.MAX_VALUE)
@AutoConfiguration
@ComponentScan("com.yc.c133.hello")
@ConditionalOnClass(Servlet.class)
@ConditionalOnBean(type="com.google.gson.Gson")
// 必须将依赖的 bean 单独定义在一个工程中, 不能定义在主工程中
//@ConditionalOnBean("com.google.gson.Gson")
@ConditionalOnProperty(prefix = "demo.hello", name = "enable")
public class HelloAutoConfiguration {
}
